
function initPoint() {
	
	$('div.c_right').tabs({
		containerClass: "c_r_body",
		selectedClass: "on",
		hash: true
	});
	
	$('#scform').submit(function(){
		var data = $(this).serializeArray();
		loadPointList(data);	
		return false;
	});
	
	$("#tocredit").keyup(function(){
		var v = this.value.replace(/[^\d]/g, '').toInt();
		var c = $('#credit').text().toInt();
		if (v > c) v = c;
		rate = $('#rate').val().toInt();
		this.value = v;
		$('#point').html(v*rate+'');
	});
	
	$('#changeform').submit(function(){
		var form = $(this);
		var msg = $("#result");
		var data = form.serializeArray();
		msg.warning(TXT_POSTDATA);
		form.disabled();
		$.ajax({
			type: "POST",
			url: form.attr("action"),
			data: data,
			dataType: "json",
			success: function(ret){
				msg.warning(ret.msg);
				if (!ret.success) {
					form.enabled();
				}
			},
			error: function(res){
				msg.warning(TXT_NETBUSY);
				form.enabled();
			}
		});
		return false;
	});
}

function loadPointList(data) {
	$('#pointlist').html(TXT_NETWAIT).load($("#scform").attr("action"), data);
}

